package com.example.demo.day.config.learn.design.order.x1;

//购买股票的具体命令类
public class BuyOrder implements Order {

    private Stock stock;

    public BuyOrder(Stock stock) {
        this.stock = stock;
    }

    @Override
    public void execute() {
        System.out.println("Buy stock: name = " + stock.getName()
                + ", quantity = " + stock.getQuantity());
    }
}
